package com.emc.esu.api.rest
{
	import flash.utils.ByteArray;
	
	public class ByteArraySegment extends ByteArray
	{
		private var ba:ByteArray;
		private var startOffset:uint = 0;
		
		public function ByteArraySegment( ba:ByteArray )
		{
			this.ba = ba;
			this.startOffset = ba.position;
		}
				
		public override function clear():void {
			ba.clear();
			startOffset = 0;
		} 
		
		public override function compress(algorithm:String="zlib"):void {
			ba.compress( algorithm );
		}
		
		public override function get bytesAvailable():uint {
			return ba.bytesAvailable;
		}
		
		
	}
}